/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntidadesBD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ROCIO
 */
@Entity
@Table(name = "contratodemateria", catalog = "secdux", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Contratodemateria.findAll", query = "SELECT c FROM Contratodemateria c"),
    @NamedQuery(name = "Contratodemateria.findById", query = "SELECT c FROM Contratodemateria c WHERE c.id = :id"),
    @NamedQuery(name = "Contratodemateria.findByIntensidadH", query = "SELECT c FROM Contratodemateria c WHERE c.intensidadH = :intensidadH"),
    @NamedQuery(name = "Contratodemateria.findByNumeroSemanas", query = "SELECT c FROM Contratodemateria c WHERE c.numeroSemanas = :numeroSemanas"),
    @NamedQuery(name = "Contratodemateria.findByValorHora", query = "SELECT c FROM Contratodemateria c WHERE c.valorHora = :valorHora")})
public class Contratodemateria implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Long id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IntensidadH", nullable = false)
    private int intensidadH;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NumeroSemanas", nullable = false)
    private int numeroSemanas;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ValorHora", nullable = false)
    private int valorHora;
    @JoinColumn(name = "Plan", referencedColumnName = "CodigoPlan", nullable = false)
    @ManyToOne(optional = false)
    private Plan plan;
    @JoinColumn(name = "Materia", referencedColumnName = "Codigo", nullable = false)
    @ManyToOne(optional = false)
    private Materia materia;
    @JoinColumn(name = "NumContrato", referencedColumnName = "NumContrato", nullable = false)
    @ManyToOne(optional = false)
    private Contrato numContrato;

    public Contratodemateria() {
    }

    public Contratodemateria(Long id) {
        this.id = id;
    }

    public Contratodemateria(Long id, int intensidadH, int numeroSemanas, int valorHora) {
        this.id = id;
        this.intensidadH = intensidadH;
        this.numeroSemanas = numeroSemanas;
        this.valorHora = valorHora;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getIntensidadH() {
        return intensidadH;
    }

    public void setIntensidadH(int intensidadH) {
        this.intensidadH = intensidadH;
    }

    public int getNumeroSemanas() {
        return numeroSemanas;
    }

    public void setNumeroSemanas(int numeroSemanas) {
        this.numeroSemanas = numeroSemanas;
    }

    public int getValorHora() {
        return valorHora;
    }

    public void setValorHora(int valorHora) {
        this.valorHora = valorHora;
    }

    public Plan getPlan() {
        return plan;
    }

    public void setPlan(Plan plan) {
        this.plan = plan;
    }

    public Materia getMateria() {
        return materia;
    }

    public void setMateria(Materia materia) {
        this.materia = materia;
    }

    public Contrato getNumContrato() {
        return numContrato;
    }

    public void setNumContrato(Contrato numContrato) {
        this.numContrato = numContrato;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contratodemateria)) {
            return false;
        }
        Contratodemateria other = (Contratodemateria) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntidadesBD.Contratodemateria[ id=" + id + " ]";
    }
    
}
